import { createApp, ref } from "vue";
import App from "./App.vue";
// reset style sheet
import "@/styles/reset.scss";
// CSS common style sheet
import "@/styles/common.scss";
// iconfont css
import "@/assets/iconfont/iconfont.scss";
// font css
import "@/assets/fonts/font.scss";
// element css
import "element-plus/dist/index.css";
// element dark css
import "element-plus/theme-chalk/dark/css-vars.css";
// custom element dark css
import "@/styles/element-dark.scss";
// custom element css
import "@/styles/element.scss";
import "@/styles/style.scss";

import "@/styles/theme/auto-theme.scss";
// import "@/styles/element-variables.scss";
import "@/assets/icon-font/iconfont.css";
import "@/assets/icon-font-v2/iconfont.css";
// svg icons
import "virtual:svg-icons-register";
// element plus
import ElementPlus from "element-plus";
// element icons
import * as Icons from "@element-plus/icons-vue";
// custom directives
import directives from "@/directives/index";
// vue Router
import router from "@/routers";
// vue i18n
import I18n from "@/languages/index";
// pinia store
import pinia from "@/stores";
// errorHandler
// import errorHandler from "@/utils/errorHandler";
import heersyscom from "heersyscom";
import VueApexCharts from "vue3-apexcharts";

const app = createApp(App);

// app.config.errorHandler = errorHandler;

// register the element Icons component
Object.keys(Icons).forEach(key => {
  app.component(key, Icons[key as keyof typeof Icons]);
});
// 全局注册自定义组件
import BaseButton from "./components/BaseButton/index.vue";
import BaseUpload from "./components/BaseUpload/index.vue";
import BaseUpDown from "./components/BaseUpDown/index.vue";
import BaseDialog from "./components/BaseDialog/index.vue";

app.component("BaseButton", BaseButton);
app.component("BaseUpDown", BaseUpDown);
app.component("BaseDialog", BaseDialog);
app.component("BaseUpload", BaseUpload);
app.use(ElementPlus).use(directives).use(router).use(I18n).use(pinia).use(heersyscom).use(VueApexCharts).mount("#app");
